#!/bin/sh
echo "this is used to get my shell script total line "
sum_line=0
for i in `ls`
    do
        cur_file=$i
        file_line=`cat $cur_file |wc -l`
       #如果当前文件是脚本本身或者是以gradle结尾的,或者以properties结尾的，或者以conf结尾的，则不统计
        [ "$cur_file" == "total_line.sh" -o "${cur_file#*.}" == "gradle" -o "${cur_file#*.}" == "properties" -o "${cur_file#*.}" == "conf" \
            -o "$cur_file" == "all_channels" -o "$cur_file" == "lbcloud_modules" -o "$cur_file" == "mobile_assistant" ] && continue
        sum_line=`expr $file_line + $sum_line`
        #等价于let sum_line=$file_line+$sum_line`
        echo $cur_file lines =$file_line
    done

    echo all file total line = $sum_line

